(thoughtful music)
- [Instructor] It's time for another challenge.
This is your chance to practice
using bipolar junction transistors
as switches to control an electric motor.
A simple brushless DC motor can spin clockwise
or counterclockwise depending on the polarity
of the supply voltage
and the direction of the current through it.
If the motor is being controlled
by a basic high side or low side switch,
that switch can only turn the motor on or off,
but it can't change the orientation
of the voltage or current
to control the motor's direction.
In many applications,
such as when working with robotics,
motors need to turn in both the clockwise
and counter clockwise direction
to move back and forth,
and to control motors to do that
it's common to use a configuration
of four transistors called an H bridge.
The H bridge gets its name
because the circuit resembles
the capitol letter H.
It consists of two NPN
and two PNP transistors
positioned around the motor as shown here.
Except that on this diagram
the transistor symbols are missing their arrows
to indicate which type of transistor
they should be.
For this challenge I need your help
to determine whether each of these transistors
should be an NPN or a PNP,
and how each one should be oriented.
The H bridge is controlled by two input signals
on the left and the right side,
labeled here a A and B.
It's common to use two digital output lines
from a mic controller device
to control those inputs.
When those input signals are being produced
by a digital micro controller,
they can be in one of two possible states,
low or high.
In the low state
the input signal will be zero volts,
and in the high state
the signal will be a positive voltage.
In the case of Arduino micro controller,
the digital high output is five volts.
When input A is in the low state
and input B is in the high state
the transistors in the H bridge
will be turned on and off
such that current will flow
from the voltage source
connected to the top left transistor,
in this case five volts,
and that current will flow down
through the motor
and then through the bottom right transistor
to ground.
The direction of the current through the motor
will cause it to turn clockwise.
If the input signals are swapped
so that B is in the low state
and A is in the high state,
then current will flow
from the top right transistor through the motor
and down to ground
through the bottom left transistor.
Since current through the motor
is flowing in the opposite direction from before,
it'll cause the motor to turn counterclockwise.
If input A and B are both high,
or input A and B are both low,
then no current will flow through the motor
so it'll be stopped.
This table lists four possible states
for the two input signals
and the corresponding motor direction
for each one.
I've included this table and the H bridge diagram
in the exercise files for you to use as reference.
Your goal for this challenge
is to determine which of the transistors
in the H bridge configuration
should be NPN, which of the transistors
should be PNP, and how each of those transistors
should be oriented in the circuit.
Which side should be the emitter
versus the collector.
Now, in addition to removing the arrows
from the transistor symbols,
I've also simplified this diagram
by removing several other circuit elements from it.
If you're feeling up for an extra challenge,
determine where you should place resistors
within this H bridge circuit
to protect the transistors
from drawing too much current.
Take some time to think through this challenge,
and when you're done
be sure to watch my solution video
to see how I approach the problem.